import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/sys/user/login',
    method: 'post',
    data
  })
}

// 前端设置发送 查询用户信息的请求
export function getInfo(token) {
  return request({
    url: '/sys/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/sys/user/logout',
    method: 'post'
  })
}

export function getList(params) {
  return request({
    url: '/total/user/list',
    method: 'get',
    params
  })
}

export function deleteById(params) {
  return request({
    url: '/total/user/del',
    method: 'get',
    params
  })
}

export function addTotalSales(data) {
  return request({
    url: '/total/user/add',
    method: 'post',
    data
  })
}

export function delBatch(params) {
  return request({
    url: '/total/user/delBatch',
    method: 'get',
    params
  })
}

export function change(data) {
  return request({
    url: '/total/user/change',
    method: 'post',
    data
  })
}

export function findAll2(params) {
  return request({
    url: '/total/user/list1',
    method: 'get',
    params
  })
}
